import java.util.Scanner;
//字符串替换
public class Test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();

        char[] arr = sc.next().toCharArray();
        StringBuffer ret = new StringBuffer();
        int j = 0;
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) != '%') {
                ret.append(str.charAt(i));
            } else {
                if (str.charAt(i + 1) == 's') {
                    ret.append(arr[j]);
                    j++;
                    i++;

                } else {
                    ret.append(str.charAt(i));
                }
            }
        }
        while(j < arr.length) {
            ret.append(arr[j]);
            j++;
        }
        System.out.println(ret);
    }

}